use vizia_core::prelude::CursorIcon as ViziaCursorIcon;
use vizia_input::Code as ViziaCode;
use vizia_input::Key as ViziaKey;
use winit::keyboard::KeyCode;
use winit::keyboard::NamedKey;
use winit::window::CursorIcon as WinitCursorIcon;

pub fn cursor_icon_to_cursor_icon(cursor_icon: ViziaCursorIcon) -> Option<WinitCursorIcon> {
    match cursor_icon {
        ViziaCursorIcon::Default => Some(WinitCursorIcon::Default),
        ViziaCursorIcon::Crosshair => Some(WinitCursorIcon::Crosshair),
        ViziaCursorIcon::Hand => Some(WinitCursorIcon::Pointer),
        ViziaCursorIcon::Arrow => Some(WinitCursorIcon::Default),
        ViziaCursorIcon::Move => Some(WinitCursorIcon::Move),
        ViziaCursorIcon::Text => Some(WinitCursorIcon::Text),
        ViziaCursorIcon::Wait => Some(WinitCursorIcon::Wait),
        ViziaCursorIcon::Help => Some(WinitCursorIcon::Help),
        ViziaCursorIcon::Progress => Some(WinitCursorIcon::Progress),
        ViziaCursorIcon::NotAllowed => Some(WinitCursorIcon::NotAllowed),
        ViziaCursorIcon::ContextMenu => Some(WinitCursorIcon::ContextMenu),
        ViziaCursorIcon::Cell => Some(WinitCursorIcon::Cell),
        ViziaCursorIcon::VerticalText => Some(WinitCursorIcon::VerticalText),
        ViziaCursorIcon::Alias => Some(WinitCursorIcon::Alias),
        ViziaCursorIcon::Copy => Some(WinitCursorIcon::Copy),
        ViziaCursorIcon::NoDrop => Some(WinitCursorIcon::NoDrop),
        ViziaCursorIcon::Grab => Some(WinitCursorIcon::Grab),
        ViziaCursorIcon::Grabbing => Some(WinitCursorIcon::Grabbing),
        ViziaCursorIcon::AllScroll => Some(WinitCursorIcon::AllScroll),
        ViziaCursorIcon::ZoomIn => Some(WinitCursorIcon::ZoomIn),
        ViziaCursorIcon::ZoomOut => Some(WinitCursorIcon::ZoomOut),
        ViziaCursorIcon::EResize => Some(WinitCursorIcon::EResize),
        ViziaCursorIcon::NResize => Some(WinitCursorIcon::NResize),
        ViziaCursorIcon::NeResize => Some(WinitCursorIcon::NeResize),
        ViziaCursorIcon::NwResize => Some(WinitCursorIcon::NwResize),
        ViziaCursorIcon::SResize => Some(WinitCursorIcon::SResize),
        ViziaCursorIcon::SeResize => Some(WinitCursorIcon::SeResize),
        ViziaCursorIcon::SwResize => Some(WinitCursorIcon::SwResize),
        ViziaCursorIcon::WResize => Some(WinitCursorIcon::WResize),
        ViziaCursorIcon::EwResize => Some(WinitCursorIcon::EwResize),
        ViziaCursorIcon::NsResize => Some(WinitCursorIcon::NsResize),
        ViziaCursorIcon::NeswResize => Some(WinitCursorIcon::NeswResize),
        ViziaCursorIcon::NwseResize => Some(WinitCursorIcon::NwseResize),
        ViziaCursorIcon::ColResize => Some(WinitCursorIcon::ColResize),
        ViziaCursorIcon::RowResize => Some(WinitCursorIcon::RowResize),
        ViziaCursorIcon::None => None,
    }
}

pub fn winit_key_code_to_code(virtual_key_code: KeyCode) -> ViziaCode {
    use winit::keyboard::KeyCode::*;
    match virtual_key_code {
        Digit1 => ViziaCode::Digit1,
        Digit2 => ViziaCode::Digit2,
        Digit3 => ViziaCode::Digit3,
        Digit4 => ViziaCode::Digit4,
        Digit5 => ViziaCode::Digit5,
        Digit6 => ViziaCode::Digit6,
        Digit7 => ViziaCode::Digit7,
        Digit8 => ViziaCode::Digit8,
        Digit9 => ViziaCode::Digit9,
        Digit0 => ViziaCode::Digit0,
        KeyA => ViziaCode::KeyA,
        KeyB => ViziaCode::KeyB,
        KeyC => ViziaCode::KeyC,
        KeyD => ViziaCode::KeyD,
        KeyE => ViziaCode::KeyE,
        KeyF => ViziaCode::KeyF,
        KeyG => ViziaCode::KeyG,
        KeyH => ViziaCode::KeyH,
        KeyI => ViziaCode::KeyI,
        KeyJ => ViziaCode::KeyJ,
        KeyK => ViziaCode::KeyK,
        KeyL => ViziaCode::KeyL,
        KeyM => ViziaCode::KeyM,
        KeyN => ViziaCode::KeyN,
        KeyO => ViziaCode::KeyO,
        KeyP => ViziaCode::KeyP,
        KeyQ => ViziaCode::KeyQ,
        KeyR => ViziaCode::KeyR,
        KeyS => ViziaCode::KeyS,
        KeyT => ViziaCode::KeyT,
        KeyU => ViziaCode::KeyU,
        KeyV => ViziaCode::KeyV,
        KeyW => ViziaCode::KeyW,
        KeyX => ViziaCode::KeyX,
        KeyY => ViziaCode::KeyY,
        KeyZ => ViziaCode::KeyZ,
        Escape => ViziaCode::Escape,
        F1 => ViziaCode::F1,
        F2 => ViziaCode::F2,
        F3 => ViziaCode::F3,
        F4 => ViziaCode::F4,
        F5 => ViziaCode::F5,
        F6 => ViziaCode::F6,
        F7 => ViziaCode::F7,
        F8 => ViziaCode::F8,
        F9 => ViziaCode::F9,
        F10 => ViziaCode::F10,
        F11 => ViziaCode::F11,
        F12 => ViziaCode::F12,
        Insert => ViziaCode::Insert,
        Home => ViziaCode::Home,
        Delete => ViziaCode::Delete,
        End => ViziaCode::End,
        PageDown => ViziaCode::PageDown,
        PageUp => ViziaCode::PageUp,
        ArrowLeft => ViziaCode::ArrowLeft,
        ArrowUp => ViziaCode::ArrowUp,
        ArrowRight => ViziaCode::ArrowRight,
        ArrowDown => ViziaCode::ArrowDown,
        Backspace => ViziaCode::Backspace,
        Enter => ViziaCode::Enter,
        Space => ViziaCode::Space,
        Numpad0 => ViziaCode::Numpad0,
        Numpad1 => ViziaCode::Numpad1,
        Numpad2 => ViziaCode::Numpad2,
        Numpad3 => ViziaCode::Numpad3,
        Numpad4 => ViziaCode::Numpad4,
        Numpad5 => ViziaCode::Numpad5,
        Numpad6 => ViziaCode::Numpad6,
        Numpad7 => ViziaCode::Numpad7,
        Numpad8 => ViziaCode::Numpad8,
        Numpad9 => ViziaCode::Numpad9,
        NumpadAdd => ViziaCode::NumpadAdd,
        NumpadDivide => ViziaCode::NumpadDivide,
        NumpadDecimal => ViziaCode::NumpadDecimal,
        NumpadComma => ViziaCode::NumpadComma,
        NumpadEnter => ViziaCode::NumpadEnter,
        NumpadEqual => ViziaCode::NumpadEqual,
        NumpadMultiply => ViziaCode::NumpadMultiply,
        NumpadSubtract => ViziaCode::NumpadSubtract,
        Comma => ViziaCode::Comma,
        Equal => ViziaCode::Equal,
        Backquote => ViziaCode::Backquote,
        AltLeft => ViziaCode::AltLeft,
        BracketLeft => ViziaCode::BracketLeft,
        ControlLeft => ViziaCode::ControlLeft,
        ShiftLeft => ViziaCode::ShiftLeft,
        Minus => ViziaCode::Minus,
        Period => ViziaCode::Period,
        Semicolon => ViziaCode::Semicolon,
        Slash => ViziaCode::Slash,
        Tab => ViziaCode::Tab,
        _ => ViziaCode::NonConvert,
    }
}

pub fn _scan_code_to_code(scan_code: u32) -> ViziaCode {
    match scan_code {
        0x001 => ViziaCode::Escape,
        0x002 => ViziaCode::Digit1,
        0x003 => ViziaCode::Digit2,
        0x004 => ViziaCode::Digit3,
        0x005 => ViziaCode::Digit4,
        0x006 => ViziaCode::Digit5,
        0x007 => ViziaCode::Digit6,
        0x008 => ViziaCode::Digit7,
        0x009 => ViziaCode::Digit8,
        0x00A => ViziaCode::Digit9,
        0x00B => ViziaCode::Digit0,
        0x00C => ViziaCode::Minus,
        0x00D => ViziaCode::Equal,
        0x00E => ViziaCode::Backspace,
        0x00F => ViziaCode::Tab,
        0x010 => ViziaCode::KeyQ,
        0x011 => ViziaCode::KeyW,
        0x012 => ViziaCode::KeyE,
        0x013 => ViziaCode::KeyR,
        0x014 => ViziaCode::KeyT,
        0x015 => ViziaCode::KeyY,
        0x016 => ViziaCode::KeyU,
        0x017 => ViziaCode::KeyI,
        0x018 => ViziaCode::KeyO,
        0x019 => ViziaCode::KeyP,
        0x01A => ViziaCode::BracketLeft,
        0x01B => ViziaCode::BracketRight,
        0x01C => ViziaCode::Enter,
        0x01D => ViziaCode::ControlLeft,
        0x01E => ViziaCode::KeyA,
        0x01F => ViziaCode::KeyS,
        0x020 => ViziaCode::KeyD,
        0x021 => ViziaCode::KeyF,
        0x022 => ViziaCode::KeyG,
        0x023 => ViziaCode::KeyH,
        0x024 => ViziaCode::KeyJ,
        0x025 => ViziaCode::KeyK,
        0x026 => ViziaCode::KeyL,
        0x027 => ViziaCode::Semicolon,
        0x028 => ViziaCode::Quote,
        0x029 => ViziaCode::Backquote,
        0x02A => ViziaCode::ShiftLeft,
        0x02B => ViziaCode::Backslash,
        0x02C => ViziaCode::KeyZ,
        0x02D => ViziaCode::KeyX,
        0x02E => ViziaCode::KeyC,
        0x02F => ViziaCode::KeyV,
        0x030 => ViziaCode::KeyB,
        0x031 => ViziaCode::KeyN,
        0x032 => ViziaCode::KeyM,
        0x033 => ViziaCode::Comma,
        0x034 => ViziaCode::Period,
        0x035 => ViziaCode::Slash,
        0x036 => ViziaCode::ShiftRight,
        0x037 => ViziaCode::NumpadMultiply,
        0x038 => ViziaCode::AltLeft,
        0x039 => ViziaCode::Space,
        0x03A => ViziaCode::CapsLock,
        0x03B => ViziaCode::F1,
        0x03C => ViziaCode::F2,
        0x03D => ViziaCode::F3,
        0x03E => ViziaCode::F4,
        0x03F => ViziaCode::F5,
        0x040 => ViziaCode::F6,
        0x041 => ViziaCode::F7,
        0x042 => ViziaCode::F8,
        0x043 => ViziaCode::F9,
        0x044 => ViziaCode::F10,
        0x045 => ViziaCode::Pause,
        0x046 => ViziaCode::ScrollLock,
        0x047 => ViziaCode::Numpad7,
        0x048 => ViziaCode::Numpad8,
        0x049 => ViziaCode::Numpad9,
        0x04A => ViziaCode::NumpadSubtract,
        0x04B => ViziaCode::Numpad4,
        0x04C => ViziaCode::Numpad5,
        0x04D => ViziaCode::Numpad6,
        0x04E => ViziaCode::NumpadAdd,
        0x04F => ViziaCode::Numpad1,
        0x050 => ViziaCode::Numpad2,
        0x051 => ViziaCode::Numpad3,
        0x052 => ViziaCode::Numpad0,
        0x053 => ViziaCode::NumpadDecimal,
        0x054 => ViziaCode::PrintScreen,
        0x056 => ViziaCode::IntlBackslash,
        0x057 => ViziaCode::F11,
        0x058 => ViziaCode::F12,
        0x059 => ViziaCode::NumpadEqual,
        0x070 => ViziaCode::KanaMode,
        0x071 => ViziaCode::Lang2,
        0x072 => ViziaCode::Lang1,
        0x073 => ViziaCode::IntlRo,
        0x079 => ViziaCode::Convert,
        0x07B => ViziaCode::NonConvert,
        0x07D => ViziaCode::IntlYen,
        0x07E => ViziaCode::NumpadComma,
        0x110 => ViziaCode::MediaTrackPrevious,
        0x119 => ViziaCode::MediaTrackNext,
        0x11C => ViziaCode::NumpadEnter,
        0x11D => ViziaCode::ControlRight,
        0x120 => ViziaCode::AudioVolumeMute,
        0x121 => ViziaCode::LaunchApp2,
        0x122 => ViziaCode::MediaPlayPause,
        0x124 => ViziaCode::MediaStop,
        0x12E => ViziaCode::AudioVolumeDown,
        0x130 => ViziaCode::AudioVolumeUp,
        0x132 => ViziaCode::BrowserHome,
        0x135 => ViziaCode::NumpadDivide,
        0x137 => ViziaCode::PrintScreen,
        0x138 => ViziaCode::AltRight,
        0x145 => ViziaCode::NumLock,
        0x147 => ViziaCode::Home,
        0x148 => ViziaCode::ArrowUp,
        0x149 => ViziaCode::PageUp,
        0x14B => ViziaCode::ArrowLeft,
        0x14D => ViziaCode::ArrowRight,
        0x14F => ViziaCode::End,
        0x150 => ViziaCode::ArrowDown,
        0x151 => ViziaCode::PageDown,
        0x152 => ViziaCode::Insert,
        0x153 => ViziaCode::Delete,
        0x15B => ViziaCode::MetaLeft,
        0x15C => ViziaCode::MetaRight,
        0x15D => ViziaCode::ContextMenu,
        0x15E => ViziaCode::Power,
        0x165 => ViziaCode::BrowserSearch,
        0x166 => ViziaCode::BrowserFavorites,
        0x167 => ViziaCode::BrowserRefresh,
        0x168 => ViziaCode::BrowserStop,
        0x169 => ViziaCode::BrowserForward,
        0x16A => ViziaCode::BrowserBack,
        0x16B => ViziaCode::LaunchApp1,
        0x16C => ViziaCode::LaunchMail,
        0x16D => ViziaCode::MediaSelect,
        0x1F1 => ViziaCode::Lang2,
        0x1F2 => ViziaCode::Lang1,
        _ => ViziaCode::Unidentified,
    }
}

pub fn winit_key_to_key(virtual_key_code: NamedKey) -> Option<ViziaKey> {
    use winit::keyboard::NamedKey::*;
    match virtual_key_code {
        Backspace => Some(ViziaKey::Backspace),
        Tab => Some(ViziaKey::Tab),
        Enter => Some(ViziaKey::Enter),
        Shift => Some(ViziaKey::Shift),
        Control => Some(ViziaKey::Control),
        Alt => Some(ViziaKey::Alt),
        Pause => Some(ViziaKey::Pause),
        CapsLock => Some(ViziaKey::CapsLock),
        // TODO: disambiguate kana and hangul? same vk
        KanaMode => Some(ViziaKey::KanaMode),
        KanjiMode => Some(ViziaKey::KanjiMode),
        Escape => Some(ViziaKey::Escape),
        PageUp => Some(ViziaKey::PageUp),
        PageDown => Some(ViziaKey::PageDown),
        End => Some(ViziaKey::End),
        Home => Some(ViziaKey::Home),
        ArrowLeft => Some(ViziaKey::ArrowLeft),
        ArrowUp => Some(ViziaKey::ArrowUp),
        ArrowRight => Some(ViziaKey::ArrowRight),
        ArrowDown => Some(ViziaKey::ArrowDown),
        Select => Some(ViziaKey::Select),
        Print => Some(ViziaKey::Print),
        Insert => Some(ViziaKey::Insert),
        Delete => Some(ViziaKey::Delete),
        Meta => Some(ViziaKey::Meta),
        ContextMenu => Some(ViziaKey::ContextMenu),
        Standby => Some(ViziaKey::Standby),
        F1 => Some(ViziaKey::F1),
        F2 => Some(ViziaKey::F2),
        F3 => Some(ViziaKey::F3),
        F4 => Some(ViziaKey::F4),
        F5 => Some(ViziaKey::F5),
        F6 => Some(ViziaKey::F6),
        F7 => Some(ViziaKey::F7),
        F8 => Some(ViziaKey::F8),
        F9 => Some(ViziaKey::F9),
        F10 => Some(ViziaKey::F10),
        F11 => Some(ViziaKey::F11),
        F12 => Some(ViziaKey::F12),
        NumLock => Some(ViziaKey::NumLock),
        ScrollLock => Some(ViziaKey::ScrollLock),
        AltGraph => Some(ViziaKey::AltGraph),
        Fn => Some(ViziaKey::Fn),
        FnLock => Some(ViziaKey::FnLock),
        Symbol => Some(ViziaKey::Symbol),
        SymbolLock => Some(ViziaKey::SymbolLock),
        Hyper => Some(ViziaKey::Hyper),
        Super => Some(ViziaKey::Super),
        Space => None,
        Clear => Some(ViziaKey::Clear),
        Copy => Some(ViziaKey::Copy),
        CrSel => Some(ViziaKey::CrSel),
        Cut => Some(ViziaKey::Cut),
        EraseEof => Some(ViziaKey::EraseEof),
        ExSel => Some(ViziaKey::ExSel),
        Paste => Some(ViziaKey::Paste),
        Redo => Some(ViziaKey::Redo),
        Undo => Some(ViziaKey::Undo),
        Accept => Some(ViziaKey::Accept),
        Again => Some(ViziaKey::Again),
        Attn => Some(ViziaKey::Attn),
        Cancel => Some(ViziaKey::Cancel),
        Execute => Some(ViziaKey::Execute),
        Find => Some(ViziaKey::Find),
        Help => Some(ViziaKey::Help),
        Play => Some(ViziaKey::Play),
        Props => Some(ViziaKey::Props),
        ZoomIn => Some(ViziaKey::ZoomIn),
        ZoomOut => Some(ViziaKey::ZoomOut),
        BrightnessDown => Some(ViziaKey::BrightnessDown),
        BrightnessUp => Some(ViziaKey::BrightnessUp),
        Eject => Some(ViziaKey::Eject),
        LogOff => Some(ViziaKey::LogOff),
        Power => Some(ViziaKey::Power),
        PowerOff => Some(ViziaKey::PowerOff),
        PrintScreen => Some(ViziaKey::PrintScreen),
        Hibernate => Some(ViziaKey::Hibernate),
        WakeUp => Some(ViziaKey::WakeUp),
        AllCandidates => Some(ViziaKey::AllCandidates),
        Alphanumeric => Some(ViziaKey::Alphanumeric),
        CodeInput => Some(ViziaKey::CodeInput),
        Compose => Some(ViziaKey::Compose),
        Convert => Some(ViziaKey::Convert),
        FinalMode => Some(ViziaKey::FinalMode),
        GroupFirst => Some(ViziaKey::GroupFirst),
        GroupLast => Some(ViziaKey::GroupLast),
        GroupNext => Some(ViziaKey::GroupNext),
        GroupPrevious => Some(ViziaKey::GroupPrevious),
        ModeChange => Some(ViziaKey::ModeChange),
        NextCandidate => Some(ViziaKey::NextCandidate),
        NonConvert => Some(ViziaKey::NonConvert),
        PreviousCandidate => Some(ViziaKey::PreviousCandidate),
        Process => Some(ViziaKey::Process),
        SingleCandidate => Some(ViziaKey::SingleCandidate),
        HangulMode => Some(ViziaKey::HangulMode),
        HanjaMode => Some(ViziaKey::HanjaMode),
        JunjaMode => Some(ViziaKey::JunjaMode),
        Eisu => Some(ViziaKey::Eisu),
        Hankaku => Some(ViziaKey::Hankaku),
        Hiragana => Some(ViziaKey::Hiragana),
        HiraganaKatakana => Some(ViziaKey::HiraganaKatakana),
        Katakana => Some(ViziaKey::Katakana),
        Romaji => Some(ViziaKey::Romaji),
        Zenkaku => Some(ViziaKey::Zenkaku),
        ZenkakuHankaku => Some(ViziaKey::ZenkakuHankaku),
        Soft1 => Some(ViziaKey::Soft1),
        Soft2 => Some(ViziaKey::Soft2),
        Soft3 => Some(ViziaKey::Soft3),
        Soft4 => Some(ViziaKey::Soft4),
        ChannelDown => Some(ViziaKey::ChannelDown),
        ChannelUp => Some(ViziaKey::ChannelUp),
        Close => Some(ViziaKey::Close),
        MailForward => Some(ViziaKey::MailForward),
        MailReply => Some(ViziaKey::MailReply),
        MailSend => Some(ViziaKey::MailSend),
        MediaClose => Some(ViziaKey::MediaClose),
        MediaFastForward => Some(ViziaKey::MediaFastForward),
        MediaPause => Some(ViziaKey::MediaPause),
        MediaPlay => Some(ViziaKey::MediaPlay),
        MediaPlayPause => Some(ViziaKey::MediaPlayPause),
        MediaRecord => Some(ViziaKey::MediaRecord),
        MediaRewind => Some(ViziaKey::MediaRewind),
        MediaStop => Some(ViziaKey::MediaStop),
        MediaTrackNext => Some(ViziaKey::MediaTrackNext),
        MediaTrackPrevious => Some(ViziaKey::MediaTrackPrevious),
        New => Some(ViziaKey::New),
        Open => Some(ViziaKey::Open),
        Save => Some(ViziaKey::Save),
        SpellCheck => Some(ViziaKey::SpellCheck),
        Key11 => Some(ViziaKey::Key11),
        Key12 => Some(ViziaKey::Key12),
        AudioBalanceLeft => Some(ViziaKey::AudioBalanceLeft),
        AudioBalanceRight => Some(ViziaKey::AudioBalanceRight),
        AudioBassBoostDown => Some(ViziaKey::AudioBassBoostDown),
        AudioBassBoostToggle => Some(ViziaKey::AudioBassBoostToggle),
        AudioBassBoostUp => Some(ViziaKey::AudioBassBoostUp),
        AudioFaderFront => Some(ViziaKey::AudioFaderFront),
        AudioFaderRear => Some(ViziaKey::AudioFaderRear),
        AudioSurroundModeNext => Some(ViziaKey::AudioSurroundModeNext),
        AudioTrebleDown => Some(ViziaKey::AudioTrebleDown),
        AudioTrebleUp => Some(ViziaKey::AudioTrebleUp),
        AudioVolumeDown => Some(ViziaKey::AudioVolumeDown),
        AudioVolumeUp => Some(ViziaKey::AudioVolumeUp),
        AudioVolumeMute => Some(ViziaKey::AudioVolumeMute),
        MicrophoneToggle => Some(ViziaKey::MicrophoneToggle),
        MicrophoneVolumeDown => Some(ViziaKey::MicrophoneVolumeDown),
        MicrophoneVolumeUp => Some(ViziaKey::MicrophoneVolumeUp),
        MicrophoneVolumeMute => Some(ViziaKey::MicrophoneVolumeMute),
        SpeechCorrectionList => Some(ViziaKey::SpeechCorrectionList),
        SpeechInputToggle => Some(ViziaKey::SpeechInputToggle),
        LaunchApplication1 => Some(ViziaKey::LaunchApplication1),
        LaunchApplication2 => Some(ViziaKey::LaunchApplication2),
        LaunchCalendar => Some(ViziaKey::LaunchCalendar),
        LaunchContacts => Some(ViziaKey::LaunchContacts),
        LaunchMail => Some(ViziaKey::LaunchMail),
        LaunchMediaPlayer => Some(ViziaKey::LaunchMediaPlayer),
        LaunchMusicPlayer => Some(ViziaKey::LaunchMusicPlayer),
        LaunchPhone => Some(ViziaKey::LaunchPhone),
        LaunchScreenSaver => Some(ViziaKey::LaunchScreenSaver),
        LaunchSpreadsheet => Some(ViziaKey::LaunchSpreadsheet),
        LaunchWebBrowser => Some(ViziaKey::LaunchWebBrowser),
        LaunchWebCam => Some(ViziaKey::LaunchWebCam),
        LaunchWordProcessor => Some(ViziaKey::LaunchWordProcessor),
        BrowserBack => Some(ViziaKey::BrowserBack),
        BrowserFavorites => Some(ViziaKey::BrowserFavorites),
        BrowserForward => Some(ViziaKey::BrowserForward),
        BrowserHome => Some(ViziaKey::BrowserHome),
        BrowserRefresh => Some(ViziaKey::BrowserRefresh),
        BrowserSearch => Some(ViziaKey::BrowserSearch),
        BrowserStop => Some(ViziaKey::BrowserStop),
        AppSwitch => Some(ViziaKey::AppSwitch),
        Call => Some(ViziaKey::Call),
        Camera => Some(ViziaKey::Camera),
        CameraFocus => Some(ViziaKey::CameraFocus),
        EndCall => Some(ViziaKey::EndCall),
        GoBack => Some(ViziaKey::GoBack),
        GoHome => Some(ViziaKey::GoHome),
        HeadsetHook => Some(ViziaKey::HeadsetHook),
        LastNumberRedial => Some(ViziaKey::LastNumberRedial),
        Notification => Some(ViziaKey::Notification),
        MannerMode => Some(ViziaKey::MannerMode),
        VoiceDial => Some(ViziaKey::VoiceDial),
        TV => Some(ViziaKey::TV),
        TV3DMode => Some(ViziaKey::TV3DMode),
        TVAntennaCable => Some(ViziaKey::TVAntennaCable),
        TVAudioDescription => Some(ViziaKey::TVAudioDescription),
        TVAudioDescriptionMixDown => Some(ViziaKey::TVAudioDescriptionMixDown),
        TVAudioDescriptionMixUp => Some(ViziaKey::TVAudioDescriptionMixUp),
        TVContentsMenu => Some(ViziaKey::TVContentsMenu),
        TVDataService => Some(ViziaKey::TVDataService),
        TVInput => Some(ViziaKey::TVInput),
        TVInputComponent1 => Some(ViziaKey::TVInputComponent1),
        TVInputComponent2 => Some(ViziaKey::TVInputComponent2),
        TVInputComposite1 => Some(ViziaKey::TVInputComposite1),
        TVInputComposite2 => Some(ViziaKey::TVInputComposite2),
        TVInputHDMI1 => Some(ViziaKey::TVInputHDMI1),
        TVInputHDMI2 => Some(ViziaKey::TVInputHDMI2),
        TVInputHDMI3 => Some(ViziaKey::TVInputHDMI3),
        TVInputHDMI4 => Some(ViziaKey::TVInputHDMI4),
        TVInputVGA1 => Some(ViziaKey::TVInputVGA1),
        TVMediaContext => Some(ViziaKey::TVMediaContext),
        TVNetwork => Some(ViziaKey::TVNetwork),
        TVNumberEntry => Some(ViziaKey::TVNumberEntry),
        TVPower => Some(ViziaKey::TVPower),
        TVRadioService => Some(ViziaKey::TVRadioService),
        TVSatellite => Some(ViziaKey::TVSatellite),
        TVSatelliteBS => Some(ViziaKey::TVSatelliteBS),
        TVSatelliteCS => Some(ViziaKey::TVSatelliteCS),
        TVSatelliteToggle => Some(ViziaKey::TVSatelliteToggle),
        TVTerrestrialAnalog => Some(ViziaKey::TVTerrestrialAnalog),
        TVTerrestrialDigital => Some(ViziaKey::TVTerrestrialDigital),
        TVTimer => Some(ViziaKey::TVTimer),
        AVRInput => Some(ViziaKey::AVRInput),
        AVRPower => Some(ViziaKey::AVRPower),
        ColorF0Red => Some(ViziaKey::ColorF0Red),
        ColorF1Green => Some(ViziaKey::ColorF1Green),
        ColorF2Yellow => Some(ViziaKey::ColorF2Yellow),
        ColorF3Blue => Some(ViziaKey::ColorF3Blue),
        ColorF4Grey => Some(ViziaKey::ColorF4Grey),
        ColorF5Brown => Some(ViziaKey::ColorF5Brown),
        ClosedCaptionToggle => Some(ViziaKey::ClosedCaptionToggle),
        Dimmer => Some(ViziaKey::Dimmer),
        DisplaySwap => Some(ViziaKey::DisplaySwap),
        DVR => Some(ViziaKey::DVR),
        Exit => Some(ViziaKey::Exit),
        FavoriteClear0 => Some(ViziaKey::FavoriteClear0),
        FavoriteClear1 => Some(ViziaKey::FavoriteClear1),
        FavoriteClear2 => Some(ViziaKey::FavoriteClear2),
        FavoriteClear3 => Some(ViziaKey::FavoriteClear3),
        FavoriteRecall0 => Some(ViziaKey::FavoriteRecall0),
        FavoriteRecall1 => Some(ViziaKey::FavoriteRecall1),
        FavoriteRecall2 => Some(ViziaKey::FavoriteRecall2),
        FavoriteRecall3 => Some(ViziaKey::FavoriteRecall3),
        FavoriteStore0 => Some(ViziaKey::FavoriteStore0),
        FavoriteStore1 => Some(ViziaKey::FavoriteStore1),
        FavoriteStore2 => Some(ViziaKey::FavoriteStore2),
        FavoriteStore3 => Some(ViziaKey::FavoriteStore3),
        Guide => Some(ViziaKey::Guide),
        GuideNextDay => Some(ViziaKey::GuideNextDay),
        GuidePreviousDay => Some(ViziaKey::GuidePreviousDay),
        Info => Some(ViziaKey::Info),
        InstantReplay => Some(ViziaKey::InstantReplay),
        Link => Some(ViziaKey::Link),
        ListProgram => Some(ViziaKey::ListProgram),
        LiveContent => Some(ViziaKey::LiveContent),
        Lock => Some(ViziaKey::Lock),
        MediaApps => Some(ViziaKey::MediaApps),
        MediaAudioTrack => Some(ViziaKey::MediaAudioTrack),
        MediaLast => Some(ViziaKey::MediaLast),
        MediaSkipBackward => Some(ViziaKey::MediaSkipBackward),
        MediaSkipForward => Some(ViziaKey::MediaSkipForward),
        MediaStepBackward => Some(ViziaKey::MediaStepBackward),
        MediaStepForward => Some(ViziaKey::MediaStepForward),
        MediaTopMenu => Some(ViziaKey::MediaTopMenu),
        NavigateIn => Some(ViziaKey::NavigateIn),
        NavigateNext => Some(ViziaKey::NavigateNext),
        NavigateOut => Some(ViziaKey::NavigateOut),
        NavigatePrevious => Some(ViziaKey::NavigatePrevious),
        NextFavoriteChannel => Some(ViziaKey::NextFavoriteChannel),
        NextUserProfile => Some(ViziaKey::NextUserProfile),
        OnDemand => Some(ViziaKey::OnDemand),
        Pairing => Some(ViziaKey::Pairing),
        PinPDown => Some(ViziaKey::PinPDown),
        PinPMove => Some(ViziaKey::PinPMove),
        PinPToggle => Some(ViziaKey::PinPToggle),
        PinPUp => Some(ViziaKey::PinPUp),
        PlaySpeedDown => Some(ViziaKey::PlaySpeedDown),
        PlaySpeedReset => Some(ViziaKey::PlaySpeedReset),
        PlaySpeedUp => Some(ViziaKey::PlaySpeedUp),
        RandomToggle => Some(ViziaKey::RandomToggle),
        RcLowBattery => Some(ViziaKey::RcLowBattery),
        RecordSpeedNext => Some(ViziaKey::RecordSpeedNext),
        RfBypass => Some(ViziaKey::RfBypass),
        ScanChannelsToggle => Some(ViziaKey::ScanChannelsToggle),
        ScreenModeNext => Some(ViziaKey::ScreenModeNext),
        Settings => Some(ViziaKey::Settings),
        SplitScreenToggle => Some(ViziaKey::SplitScreenToggle),
        STBInput => Some(ViziaKey::STBInput),
        STBPower => Some(ViziaKey::STBPower),
        Subtitle => Some(ViziaKey::Subtitle),
        Teletext => Some(ViziaKey::Teletext),
        VideoModeNext => Some(ViziaKey::VideoModeNext),
        Wink => Some(ViziaKey::Wink),
        ZoomToggle => Some(ViziaKey::ZoomToggle),
        F13 => Some(ViziaKey::F13),
        F14 => Some(ViziaKey::F14),
        F15 => Some(ViziaKey::F15),
        F16 => Some(ViziaKey::F16),
        F17 => Some(ViziaKey::F17),
        F18 => Some(ViziaKey::F18),
        F19 => Some(ViziaKey::F19),
        F20 => Some(ViziaKey::F20),
        F21 => Some(ViziaKey::F21),
        F22 => Some(ViziaKey::F22),
        F23 => Some(ViziaKey::F23),
        F24 => Some(ViziaKey::F24),
        F25 => None,
        F26 => None,
        F27 => None,
        F28 => None,
        F29 => None,
        F30 => None,
        F31 => None,
        F32 => None,
        F33 => None,
        F34 => None,
        F35 => None,
        _ => None,
    }
}
